feat: PyTorch TensorDict Phase 4 - Schema Inference, IO Serialization, and Hypothesis Strategies - #2316
Open
cosmicBboy wants to merge 8 commits into
Open
Conversation
added 4 commits
April 25, 2026 18:14
…ensorDict Phase 3 - Add coerce_dtype implementation in TensorDictSchemaBackend - Support both schema-level (schema.coerce=True) and tensor-level coerce flags - Handle both TensorDict and tensorclass objects during coercion - Added 9 comprehensive tests for coercion functionality - Updated documentation with type coercion examples Phase 2 backend infrastructure was already implemented in Phase 1. Phase 3 adds dtype coercion capability to match other pandera backends.
…ion, and hypothesis strategies - Implement pa.infer_schema() to automatically infer TensorDict schemas from data - Add schema.save/load() methods with YAML support for configuration management - Integrate Hypothesis strategies for property-based testing of TensorDict schemas - Include complete ML pipeline example demonstrating all Phase 4 features
- Add schema inference via pa.infer_schema() to automatically infer TensorDict schemas from data - Implement IO operations (save/load/to_yaml/from_yaml) for TensorDictSchema serialization - Integrate Hypothesis strategies (tensordict_strategy, tensorclass_strategy) for property-based testing - Update API exports and entry points in pandera/tensordict.py - Add 30 comprehensive tests covering all Phase 4 features
…trategies) - Add tensordict_schema_inference.md with pa.infer_schema() examples - Add tensordict_io.md with YAML/JSON serialization examples - Add tensordict_strategies.md with Hypothesis property-based testing docs - Update index.md to include new doc pages - Fix existing docs to use correct batch_size values
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev/pytorch-tensordict-phase1 #2316 +/- ##
=================================================================
- Coverage 78.39% 77.83% -0.56%
=================================================================
Files 193 199 +6
Lines 15925 16297 +372
=================================================================
+ Hits 12484 12685 +201
- Misses 3441 3612 +171 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Add schema inference via pa.infer_schema() to automatically infer TensorDict schemas from data - Implement IO operations (save/load/to_yaml/from_yaml) for TensorDictSchema serialization - Integrate Hypothesis strategies (tensordict_strategy, tensorclass_strategy) for property-based testing - Update API exports and entry points in pandera/tensordict.py - Add 30 comprehensive tests covering all Phase 4 features Docs: - Add tensordict_schema_inference.md with pa.infer_schema() examples - Add tensordict_io.md with YAML/JSON serialization examples - Add tensordict_strategies.md with Hypothesis property-based testing docs - Update index.md to include new doc pages
cosmicBboy
force-pushed
the
pr/pytorch-tensordict-phase3-4
branch
from
April 28, 2026 01:20
b684bfe to
c2a33ea
Compare
added 3 commits
April 27, 2026 22:38
- Add proper type annotations to _strategy_import_error decorator - Fix statistics dict typing in io/tensordict_io.py - Resolve single overload issue in schema_inference/tensordict.py - Handle optional infer_schema type in entry point
…dict-phase4 # Conflicts: # docs/source/pytorch_guide/tensordict_io.md # docs/source/pytorch_guide/tensordict_schema.md # docs/source/pytorch_guide/tensordict_strategies.md
- Fix _wrapper decorator type annotations in strategies module - Remove redundant overload signatures in schema inference - Add TYPE_CHECKING import for proper typing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PyTorch TensorDict Phase 4 Implementation
This PR implements Phase 4 features for PyTorch TensorDict integration in pandera.
What's New
🎯 Schema Inference
💾 IO Serialization/Deserialization
🧪 Hypothesis Strategies
Files Changed
New Modules:
Updated Entry Points:
Tests Added:
Documentation:
Testing
All 84 tensordict tests pass:
Related Work**
Based on: (Phase 3 already merged)